import request from '@/utils/request'

// 获取列表
export function getPropertyList(data) {
  return request.get(`/properties?`, {
    params: data
  })
}

// 获取数量
export function getCount(data) {
  return request.get(`/properties/count?`, {
    params: data
  })
}

// 获取经纪列表
export function getAgents() {
  return request.get('/agents')
}

// 获取分类列表
export function getcategories() {
  return request.get('/categories')
}

// 添加房产
export function addProperty(data) {
  return request.post('/properties', data)
}

// 删除房产
export function delProperty(id) {
  return request.delete(`/properties/${id}`)
}

// id获取指定房产
export function detailProperty(id) {
  return request.get(`/properties/${id}`)
}

// 编辑房产
export function editProperty(data) {
  return request.put(`/properties/${data.id}`, data)
}
